package com.xiaoluyy.demo.common.exception;

public enum ExceptionCode {

    Ok(0, "SUCCESS"),

    // 通用异常
    UnknownError(1100, "未知错误"),
    DataPermissionNotAllowed(10001, "数据权限不允许"),
    ParameterInConsistency(10002, "参数不一致"),
    DateParamIllegal(10003, "时间参数不合法"),
    RequiredParamNotFound(10004, "必要参数找不到"),
    DBError(10005,"数据库操作异常"),
    BeanstalkException(10006,"Beanstalk发送消息异常！"),

    //元数据异常
    AddressInfoIllegal(20001,"地址数据不合法"),
    AddressModifyFailed(20003,"地址修改失败"),
    AddressDeleteFailed(20004,"地址删除失败"),
    AddressAddFailed(20010,"地址增加失败"),
    AddressNameLengthIllegal(20016,"地址长度需要为2-100位"),
    AddressParamIlleagal(20020,"区域查询参数不合法"),
    AddressQueryFailed(20021,"区域查询失败"),
    ;

    private Integer code;
    private String comment;

    ExceptionCode(Integer code, String comment) {
        this.code = code;
        this.comment = comment;
    }

    public Integer getCode() {
        return code;
    }
    public String getComment() {
        return comment;
    }
}
